$state = `getAttr ($char + ":ac_lf_leg_settings_ctrl.ik_leg")`;

if ($state == 1)
{

//float $dupmid_position[] = `xform -q -ws -t ($char + ":midLeg_skinJnt_Lf_def_dup")`;
//float $duplow_position[] = `xform -q -ws -ro ($char + ":lowLeg_skinJnt_Lf_def_dup")`; 
//float $dupankle_position[] = `xform -q -ws -ro ($char + ":ankle_skinJnt_Lf_def_dup")`; 

float $auto_stretch_up = `getAttr ($char + ":ikfk_switch_bridge.lf_up")`;
float $auto_stretch_mid = `getAttr ($char + ":ikfk_switch_bridge.lf_mid")`;
float $auto_stretch_low = `getAttr ($char + ":ikfk_switch_bridge.lf_dn")`;

float $rotation[] = `xform -q -ws -ro ($char + ":ac_lf_hipFK_dup")`; 
xform -ws -ro $rotation[0] $rotation[1] $rotation[2] ($char + ":ac_lf_hipFK_ctrl");

float $kenn_rotation[] = `xform -q -ws -ro ($char + ":ac_lf_kneeFK_dup")`; 


float $lowleg_rotation[] = `xform -q -ws -ro ($char + ":ac_lf_lowleg_fk_dup")`; 


float $foot_rotation[] = `xform -q -ws -ro ($char + ":ac_lf_footFK_dup")`; 


float $toe_rotation[] = `xform -q -ws -ro ($char + ":sk_lf_ballC")`; 

//float $upleg_stretch = `getAttr ($char + ":ac_lf_upleg_fk_ctrl.upStretch")`;
//float $lowleg_stretch = `getAttr ($char + ":ac_lf_midleg_fk_ctrl.midStretch")`;
//float $bottomleg_stretch = `getAttr ($char + ":ac_lf_lowleg_fk_ctrl.lowStretch")`;







//setAttr ($char + ":ac_lf_hipFK_ctrl.stretch") $upleg_stretch;
//setAttr ($char + ":ac_lf_kneeFK_ctrl.stretch") $lowleg_stretch;
//setAttr ($char + ":ac_lf_kneeIK_ctrl.tx") 0;
//setAttr ($char + ":ac_lf_kneeIK_ctrl.ty") 0;
//setAttr ($char + ":ac_lf_kneeIK_ctrl.tz") 0;

//float $position[] = `xform -q -ws -t ($char + ":ac_lf_kneeIK_ctrl")`;
setAttr ($char + ":ac_lf_leg_settings_ctrl.ik_leg") 0;

xform -ws -ro $kenn_rotation[0] $kenn_rotation[1] $kenn_rotation[2] ($char + ":ac_lf_kneeFK_ctrl");
xform -ws -ro $lowleg_rotation[0] $lowleg_rotation[1] $lowleg_rotation[2] ($char + ":ac_lf_lowleg_fk_ctrl");
xform -ws -ro $foot_rotation[0] $foot_rotation[1] $foot_rotation[2] ($char + ":ac_lf_footFK_ctrl");
xform -ws -ro $toe_rotation[0] $toe_rotation[1] $toe_rotation[2] ($char + ":ac_lf_toe_ctrl");

setAttr ($char + ":ac_lf_hipFK_ctrl.stretch") ($auto_stretch_up  );
setAttr ($char + ":ac_lf_kneeFK_ctrl.stretch") ($auto_stretch_mid  );
setAttr ($char + ":ac_lf_lowleg_fk_ctrl.stretch") ($auto_stretch_low );


setAttr ($char + ":ac_lf_kneeIK_ctrl.tx") 0;
setAttr ($char + ":ac_lf_kneeIK_ctrl.ty") 0;
setAttr ($char + ":ac_lf_kneeIK_ctrl.tz") 0;


setAttr ($char + ":ac_lf_dnkneeIK_ctrl.tx") 0;
setAttr ($char + ":ac_lf_dnkneeIK_ctrl.ty") 0;
setAttr ($char + ":ac_lf_dnkneeIK_ctrl.tz") 0;

//xform -ws -t $dupmid_position[0] $dupmid_position[1] $dupmid_position[2] ($char + ":ac_lf_kneeIK_ctrl");
//xform -ws -ro $duplow_position[0] $duplow_position[1] $duplow_position[2] ($char + ":ac_lf_dnkneeIK_ctrl");

//xform -ws -t $dupmid_position[0] $dupmid_position[1] $dupmid_position[2] ($char + ":ac_lf_kneeIK_ctrl");
//xform -ws -ro $duplow_position[0] $duplow_position[1] $duplow_position[2] ($char + ":ac_lf_dnkneeIK_ctrl");
//xform -ws -ro $dupankle_position[0] $dupankle_position[1] $dupankle_position[2] ($char + ":ankle_skinJnt_Lf_def_dup");



}

else

{

float $dupmid_position[] = `xform -q -ws -t ($char + ":ac_lf_kneeIK_ctrl")`;
float $duplow_position[] = `xform -q -ws -t ($char + ":ac_lf_dnkneeIK_ctrl")`; 
//float $dupankle_position[] = `xform -q -ws -ro ($char + ":ankle_skinJnt_Lf_def_dup")`; 


float $position[] = `xform -q -ws -t ($char + ":ac_lf_footIK_dup")`;
float $rotation[] = `xform -q -ws -ro ($char + ":ac_lf_footIK_dup")`; 
xform -ws -t $position[0] $position[1] $position[2] ($char + ":ac_lf_footIK_ctrl");
xform -ws -ro $rotation[0] $rotation[1] $rotation[2] ($char + ":ac_lf_footIK_ctrl");

//float $upleg_stretch = `getAttr ($char + ":ac_lf_upleg_fk_ctrl.upStretch")`;
//float $lowleg_stretch = `getAttr ($char + ":ac_lf_midleg_fk_ctrl.midStretch")`;
//float $bottomleg_stretch = `getAttr ($char + ":ac_lf_lowleg_fk_ctrl.lowStretch")`;

float $position[] = `xform -q -ws -t ($char + ":ac_lf_legPole_dup")`;
float $rotation[] = `xform -q -ws -ro ($char + ":ac_lf_legPole_dup")`; 
xform -ws -t $position[0] $position[1] $position[2] ($char + ":ac_lf_legPole_ctrl");
xform -ws -ro $rotation[0] $rotation[1] $rotation[2] ($char + ":ac_lf_legPole_ctrl");

//float $toecomp = `getAttr ($char + ":sk_lf_ballC.rz")`;
//float $toeactual = `getAttr ($char + ":ac_lf_toe_ctrl.rx")`;
//setAttr ($char + ":ac_lf_toe_ctrl.rx") ($toecomp );


float $toe_rotation[] = `xform -q -ws -ro ($char + ":sk_lf_ballC")`; 





setAttr ($char + ":ac_lf_footIK_ctrl.footLift") 30;
setAttr ($char + ":ac_lf_footIK_ctrl.footStraight") 60;
setAttr ($char + ":ac_lf_footIK_ctrl.footRoll") 0;


setAttr ($char + ":ac_lf_footIK_ctrl.Side") 0;
setAttr ($char + ":ac_lf_footIK_ctrl.liftHeel") 0;
setAttr ($char + ":ac_lf_footIK_ctrl.pinToe") 0;
setAttr ($char + ":ac_lf_footIK_ctrl.liftFoot") 0;
setAttr ($char + ":ac_lf_footIK_ctrl.raiseToe") 0;
setAttr ($char + ":ac_lf_footIK_ctrl.shakeToe") 0;



//setAttr ($char + ":ac_lf_footIK_ctrl.lowKneeMove") 0;
setAttr ($char + ":ac_lf_footIK_ctrl.straighten") 0;
setAttr ($char + ":ac_lf_footIK_ctrl.offSet") 0;
//setAttr ($char + ":ac_lf_footIK_ctrl.upStretch") 0;
//setAttr ($char + ":ac_lf_footIK_ctrl.midStretch") 0;
//setAttr ($char + ":ac_lf_footIK_ctrl.lowStretch") 0;
setAttr ($char + ":ac_lf_footIK_ctrl.togetherStretch") 0;
//setAttr ($char + ":ac_lf_footIK_ctrl.upKneeMove") 0;








//float $position[] = `xform -q -ws -t ($char + ":ac_lf_kneeFK_ctrl")`;
//setAttr ($char + ":ac_lf_legPole_ctrl.pin_knee") 0;

setAttr ($char + ":ac_lf_leg_settings_ctrl.ik_leg") 1;

xform -ws -ro $toe_rotation[0] $toe_rotation[1] $toe_rotation[2] ($char + ":ac_lf_toe_ctrl");
//xform -ws -t $position[0] $position[1] $position[2] ($char + ":ac_lf_kneeIK_ctrl");




xform -ws -t $dupmid_position[0] $dupmid_position[1] $dupmid_position[2] ($char + ":ac_lf_kneeIK_ctrl");
xform -ws -t $duplow_position[0] $duplow_position[1] $duplow_position[2] ($char + ":ac_lf_dnkneeIK_ctrl");
//xform -ws -ro $dupankle_position[0] $dupankle_position[1] $dupankle_position[2] ($char + ":ankle_skinJnt_Lf_def_dup");

}


